home *** CD-ROM | disk | FTP | other *** search
/ PC Graphics Unleashed / PC Graphics Unleashed.iso / ch18 / rad386 / torad.man < prev    next >
Text File  |  1993-07-15  |  23KB  |  477 lines

  1. *****************************************************************************
  2.         torad.man
  3.  
  4.         This file is part of the program torad.lsp to export
  5.         RADIANCE scene description files from Autocad. 
  6.  
  7.         Copyright (C) 1993 by Georg Mischler / Lehrstuhl
  8.                               fuer Bauphysik ETH Zurich.
  9.  
  10.         Permission to use, copy, modify, and distribute this software
  11.         for any purpose and without fee is hereby granted, provided
  12.         that the above copyright notice appears in all copies and that
  13.         both that copyright notice and this permission notice appear in
  14.         all supporting documentation.
  15.  
  16.         THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
  17.         WARRANTY.  ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
  18.         PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
  19.  
  20. *****************************************************************************
  21.  
  22.  
  23. NAME
  24.     torad.lsp - Export facility from Autocad to RADIANCE scene description.
  25.  
  26.  
  27.  
  28. DESCRIPTION
  29.     Software extension for Autocad to export data to the RADIANCE light
  30.     simulation package of the Lawrence Berkeley Laboratory.
  31.  
  32.     Autocad entities can be selected and filtered by a series of options.
  33.  
  34.     Entities will be sorted by one of the three criteria color, layer or
  35.     insertion layer of blocks (toplayer) according to your choice.
  36.     The sorting results in seperate files written for every layer or color.
  37.     Other files created optionally can contain initial material definitions
  38.     (all identical), a list of "!cat" commands to include all the
  39.     information to make up a complete scene description, a setup of natural
  40.     lighting, a view description and a makefile for automatic image creation.
  41.  
  42.     Only the entities that are visible (that is their layer is on and thawed)
  43.     will be exported, even when nested in a selected block. This gives you
  44.     another method of filtering elements of your drawing especially usefull
  45.     when you want to update only part of a scene.
  46.  
  47.     The layername or color number will be part of each respective filename
  48.     to make it an unique identifier. The pipe character "|" used by Autocad
  49.     within layernames associated with externally referenced blocks, as well
  50.     as the dollar sign "$" are replaced by an underscore "_" as they are
  51.     illegal or at least confusing characters for filenames on most systems.
  52.  
  53.  
  54.  
  55. INSTALLATION
  56.     Torad.lsp can be loaded after you have copied the *.lsp/bi4, torad.dcl
  57.     and torad.mnu/x files to a location on your host which is included in
  58.     your Autocad search path. The method to specify or modify the necessary
  59.     environment variable ($ACAD) varies depending on the operating system.
  60.     You will have to quit and restart any Autocad still running for the
  61.     change to take effect.
  62.  
  63.  
  64.  
  65. LOADING
  66.     Load the program by entering (load "torad[.bi4]") at the Autocad
  67.     command prompt or automatically by activating the TORAD section in the
  68.     screen menu area of the associated menu file.
  69.     It is recommended to use compiled code which runs significantly faster.
  70.     Autolisp files compiled with the compiler "acomp(.exe)" from Autodesk
  71.     for extended Autolisp usually have the extension "*.bi4".
  72.     The menu file associated with this program tries to load such files
  73.     first if they are present and supported by your version of Autolisp.
  74.     Otherwise the uncompiled lisp files are loaded.
  75.  
  76.  
  77.  
  78. INTERFACE
  79.     The program is called by typing "torad" at the Autocad command prompt
  80.     or by selecting the "EXPORT" option in the associated screen menu
  81.     section.
  82.  
  83.     There is a dialog box for Autocad 12 or later(?) which controls all
  84.     the necessary settings. For earlier versions the same control is
  85.     provided by text input or a screen menu section.
  86.  
  87.     There are a number of toggles to switch on or off by entering "Yes"
  88.     or "No" in text mode or by selecting toggle buttons in the dialog box.
  89.     Some of the toggles affect the access to some of the others as it is
  90.     apropiate for writing only subsets of the possible data. In such a
  91.     case the respective prompts will be skipped or its input facilities
  92.     in the dialog box will be greyed out and so disabled.
  93.  
  94.     The entity sampling and sampling mode options can be preset from the
  95.     screen section of the associated menu file. They are remembered for
  96.     the current Autocad editing session.
  97.  
  98.     The layout of the dialog box is aproximated in the following graph.
  99.  
  100.     _________________________________________________________________________ 
  101.    |                    torad - radiance export facility                     |
  102.    | _______________________________________________________________________ |
  103.    |                                                                         |
  104.    | _ sampled entities ______________   _ write filetypes _________________ |
  105.    ||  _                              | |  _                                ||
  106.    || |X| Planarized faces of 3DFACEs | | |X| Geometry information          ||
  107.    ||  _                              | |  _                                ||
  108.    || |X| Extruded and flat TRACEs    | | |_| Master-Control                ||
  109.    ||  _                              | |                                   ||
  110.    || |X| Extruded and flat SOLIDs    | |    WCS Rot. from E to X:   0.0    ||
  111.    ||  _                              | |     _                             ||
  112.    || |X| Extruded and flat CIRCLEs   | |    |X| Makefile                   ||
  113.    ||  _                              | |  _                                ||
  114.    || |X| Extruded faces of ARCs      | | |_| Materials (all same)          ||
  115.    ||  _                              | |  _             __                 ||
  116.    || |X| Extruded faces of LINEs     | | |_| View:     |\/| Current        ||
  117.    ||  _                              | |  _                                ||
  118.    || |X| Extruded faces of 2D-PLINEs | | |_| Sun at position:              ||
  119.    ||  _                              | |                                   ||
  120.    || |X| Constant width of 2D-PLINEs | | Long.:   -8.5     Month:  08      ||
  121.    ||  _                              | | Lat.:    47.5     Day:    01      ||
  122.    || |_| Closed 2s-polys as POLYGONs | | TZ.:     -1       Hour:   16.5    ||
  123.    ||  _                              | |___________________________________||
  124.    || |X| Faces of 3D-MESHes          |                                      |
  125.    ||  _                              |  _ sampling modes __________________ |
  126.    || |X| Faces of POLYFACES          | | Sample entities by:               ||
  127.    ||  _                              | |  _          _          _          ||
  128.    || |_| Points as SPHEREs or BUBBLEs| | |X| Color  |_| Layer  |_| Toplayer||
  129.    ||                                 | |                                   ||
  130.    ||                                 | | Seg./circle for arcs:    16       ||
  131.    ||_________________________________| |___________________________________||
  132.    |                                        ____________     ____________    |
  133.    | Filename prefix:    ./myfile          |_____OK_____|   |___Cancel___|   |
  134.    |_________________________________________________________________________|
  135.  
  136.  
  137.  
  138.  
  139. OPTIONS
  140.     Write Filetypes:
  141.         The following toggles and settings (upper right boxed column of the
  142.         dialog box) specify which kind of information to export:
  143.  
  144.         Geometry information.
  145.             This switch is on by default for it is the generic purpose
  146.             of the program. Turning it off will disable the list of sampled
  147.             entity types and the master control file, makefile and material
  148.             file generation switches since they all don't make sense without.
  149.  
  150.         Master Control.
  151.             The created file will contain all the necessary references to
  152.             the rest of the data so that "oconv" will be satisfied with
  153.             only this control file as its single argument.
  154.             This and the switches for materials, viewfile and sun are off
  155.             by default because you probably only want to use them when you
  156.             export a complete drawing for the first time.
  157.  
  158.             Since it is not the goal of torad.lsp to make a full front end
  159.             to the RADIANCE package it will not maintain any of these files.
  160.             The information allready in there will be lost if you create
  161.             them new for every update of a part of a scene description.
  162.             In such a case you will have to edit these files manually to
  163.             keep them up to date.
  164.  
  165.             WCS Rotation from East to X.
  166.                 If your Autocad model is not aligned geograpically (so that
  167.                 the X axis points towards east and the Y axis to north) then
  168.                 you can specify the  difference as a rotation angle around
  169.                 the Z axis in degrees here.
  170.                 This will cause the sun definition (if any) to be loaded
  171.                 with the apropriate "xform -rz ..." compensation.
  172.  
  173.             Makefile.
  174.                 The makefile will contain rules for octree conversion,
  175.                 preview with rview and batch calculation with rpict.
  176.                 Only minimal parameters are included to the commands so
  177.                 you will have to edit this file as well, be it for high
  178.                 resolution image generation or other customisations.
  179.  
  180.         Materials.
  181.             All the layers or colors of the exported objects will have
  182.             the same material (a grey plastic) assigned whithin a seperate
  183.             file generated if this option is set.
  184.  
  185.         View:
  186.             This option enables a pop up list which contains the views
  187.             that have been saved previously in Autocad and the current
  188.             view. The one you select will be written to a file similar
  189.             to those written by rview which will then contain all the
  190.             information like viewtype, point, direction, angle and view
  191.             up vector. View angles larger or equal than 120 degrees will
  192.             generate a hemisperical fisheye view.
  193.             Please note that RADIANCE clips every polygon that reaches
  194.             behind the viewpoint.  This is often the case in parallel
  195.             views exported from Autocad where the viewpoint may be at a
  196.             very small offset from the world origin.
  197.  
  198.         Sun at position and time.
  199.             This option will prompt you for the parameters of natural
  200.             lighting as required by gensky.
  201.             The default values are for Zurich (Switzerland) in the
  202.             afternoon of August the 1st (This may seem exotic to you but
  203.             not to me).
  204.  
  205.  
  206.     Sampling modes.
  207.         These settings (the lower right boxed column in the dialog box) let
  208.         you specify the way the geometrical information will be converted.
  209.  
  210.         Sample entities by:
  211.             Select the sorting method here out of one of the following.
  212.  
  213.             Color
  214.                 The Autocad colornumber as visible on the screen.
  215.                 This is the default and will help you when you organize
  216.                 your drawing "visually".
  217.  
  218.             Layer
  219.                 The layer of every subentity (the one which this entity
  220.                 is created on). Choose this method if you use a conceptual
  221.                 layering system independently from screen display colors.
  222.  
  223.             Toplayer
  224.                 As above, except for entities within blocks which will be
  225.                 treated as if beeing on the layer the block is inserted on.
  226.                 Nested blocks will end all in the same file associated with
  227.                 the layer of the outermost block.
  228.                 This can be useful if you combine the use of (unnested)
  229.                 block libraries with a seperate layer structuring system.
  230.  
  231.             The concept of floating layers and colors within (nested)
  232.             blocks is fully supported. That means a subentity within a
  233.             block with the layer "0" and/or the color "byblock" will
  234.             appear on the layer and with the color of the containing block.
  235.             This continues recursively if the block has those properties as
  236.             well until a level with explicitly defined properties or the
  237.             top level block is reached.  Freestanding entities with the
  238.             color "byblock" are drawn with color nr. 7 (white).
  239.  
  240.         Segmentation per circle for arcs:
  241.             Arc entities and arc segments of polylines have to be segmented
  242.             for the use in RADIANCE. The value you enter here specifies
  243.             how smooth these segments will appear in the final image.
  244.             Higher values will make smoother surfaces. The default of 16
  245.             is rather low but is set for reducing filesize. Make tests for
  246.             optimized settings because the appearance of the segments will
  247.             depend as well on the applied material as on the radius of any
  248.             specific arc.
  249.  
  250.  
  251.     Sampled Entities:
  252.         The following switches (the left boxed row in the dialog box) let
  253.         you specify which entity types you wish to extract from your
  254.         drawing and what kind of surface they should display. By default
  255.         all entities that make up a surface in Autocad (recognized by the
  256.         hide and shade/render commands) are switched on.
  257.         Others that just simplify modelling but are rendered differentely
  258.         in Autocad or in RADIANCE are off and have to be enabled by the
  259.         user explicitly.
  260.         All polygons should keep their orientation as created in Autocad
  261.         determined by the right hand rule as explained in the RADIANCE
  262.         tutorial.
  263.         Entities extruded by thickness will be inverted if their thickness
  264.         value (or "PDSIZE" for point entities) is negative.
  265.  
  266.         The current export possibilities and their consequences are the
  267.         following:
  268.  
  269.         Planarized faces of 3DFACEs.
  270.             3dfaces will be split to two triangular polygons if not planar.
  271.  
  272.         Extruded and flat TRACEs.
  273.             Traces will appear as a single polygon or as a box if the
  274.             thickness is not zero.
  275.  
  276.         Extruded and flat SOLIDs.
  277.             Solids will appear as a single polygon or as a box if the
  278.             thickness is not zero.
  279.  
  280.         Extruded and flat CIRCLEs.
  281.             Circles will appear as a ring with a inner radius of zero
  282.             or as a cylinder/tube with a ring at either end if their
  283.             thickness is different from zero.
  284.  
  285.         Extruded faces of ARCs.
  286.             Arcs with a thickness different from zero will be segmented
  287.             according to the given number of segments per full circle.
  288.  
  289.         Extruded faces of LINEs.
  290.             Lines with a thickness different from zero will appear as a
  291.             single polygon.
  292.  
  293.         Extruded faces of 2D-PLINEs.
  294.             2d-polylines with a thickness different from zero will appear
  295.             as a set of polygons.
  296.  
  297.         Constant Width of 2D-PLINEs.
  298.             2d-polylines with a starting width different from zero set in
  299.             their header entity (not the vertexes!) will appear as a
  300.             polygon following the trace of the polyline with a constant
  301.             width. This option will override the following one for poly-
  302.             lines that match both categories (see below).
  303.             Together with a thickness and the respective option set this
  304.             will will result in a kind of a quadrilateral worm.
  305.  
  306.         Closed 2d-polys as POLYGONs.
  307.             2d-polylines with the closed flag set in their header entity
  308.             will appear as a polygon of the shape of the polyline.
  309.             polylines with a width will not follow this rule if the
  310.             previous option is chosen as well (see above).
  311.             Together with a thickness and the respective option set this
  312.             will result in a prismatic volume of the shape of the polyline.
  313.             This option is off by default.
  314.  
  315.         Faces of 3D-MESHEs.
  316.             The Faces of 3d-polygon meshes will appear as a set of
  317.             polygons ignoring spline fits of any kind. Nonplanar faces
  318.             will be split into two triangles.
  319.  
  320.         Faces of POLYFACEs.
  321.             The faces of polyface meshes (from Autocad version 11 on) will
  322.             appear as a set of polygons. Nonplanar faces will be split
  323.             into two triangles. This option has no effect in environments
  324.             older than Autocad 11.
  325.  
  326.         Points as SPHEREs or BUBBLEs.
  327.             Point entities will appear as spheres or bubbles depending on
  328.             either their thickness (if any) or else on the value of the
  329.             Autocad system variable "PDSIZE". if the result is zero the
  330.             entity is ignored.
  331.             This option is off by default.
  332.  
  333.  
  334.     Filename prefix:
  335.         The names of all output files (excluding the makefile) will start
  336.         with the string entered here. Default is the name of the drawing
  337.         file. The tilde "~" in a path name will be substituted for the
  338.         home directory ("$HOME" if present).
  339.  
  340.     OK/Cancel buttons.
  341.         The OK button starts the exporting after you have selected the
  342.         entities you wish to extract. The Cancel button discards all the
  343.         setting you have made and terminates the program.
  344.         In the text dialog mode you can press <Control>-C to exit any time.
  345.  
  346.  
  347.  
  348. DETAILS
  349.     Torad.lsp is optimized for speed and memory usage as far as possible
  350.     without loosing the functionality of sorting entities to seperate files.
  351.     Therefore just the entity names are stored for sorting and geometry is
  352.     ignored until later. The drawback is that entity data has to be
  353.     extracted twice, once for sorting and once for writing (and maybe
  354.     even more for nested blocks).
  355.  
  356.     The geometrical transformations are executed in one pass out of an
  357.     unlimited number of nested blocks as long as no multiple inserts are
  358.     involved.
  359.  
  360.  
  361.  
  362. DIAGNOSTICS
  363.     Error messages and alert boxes are meant to be self explanatory.
  364.  
  365.  
  366.  
  367. ENVIRONMENT
  368.     Autolisp variables of global scope:
  369.         *exportnsegs*   Number of segments per circle for arcs [int].
  370.         *exportsmode*   Sampling mode ["Color"|"Layer"|"Toplayer"].
  371.         *exporttruelays*
  372.                         Currently visible layers [list].
  373.         *exportentlist* Currently sorted entities [assoc.list].
  374.         *exportblocklist*
  375.                         Currently sorted blocks [assoc.list].
  376.         *valuablepolylist*
  377.                         Currently writeable entity types [list_of_strings].
  378.         *col*           Color number used for graphical debugging [int].
  379.  
  380.         *toraddlgpos*   Last position of the dialog box ['(intx, inty)].
  381.         *toradfilelist* List of filetypes and values to write [assoc.list].
  382.         *toradetypes*   List of possible types and text entry prompts.
  383.         *toradtypelist* Default list of entity types [list_of_strings].
  384.         *torad_error*   Exception handler [function].
  385.         *torad_preverr* Old exception handler for reinstalling [function].
  386.         *FILE*          Current open file [filedesc].
  387.         $REASON         Control variable for dialog box (in fact local).
  388.         BD4A            Function defined by Autolisp for compiler support.
  389.  
  390.     Operating system environment:
  391.         HOME            Home directory used for tilde replacement.
  392.         ACAD            List of directories where Autocad looks for
  393.                         supporting files.
  394.  
  395.  
  396.  
  397. FILES
  398.     Program files:
  399.         torad.lsp       Main program source file.
  400.         esample.lsp     Entities sampling and conversion source file.
  401.         vector.lsp      Geometrical utilities source file.
  402.         torad.dcl       Dialog box definition file for Autocad 12.
  403.         torad.mnu/x     Menu file for setup with Autocad 10/11.
  404.     Additional Files:
  405.         torad.man       This File.
  406.         torad.README    general info.
  407.  
  408.     Data files:
  409.         <prefix>l_<layername>.rad
  410.                         Geometry data written with the Layer or Toplayer
  411.                         samplemodes set.
  412.         <prefix>c_<colornumber>.rad
  413.                         Geometry data written with the Color samplemode set.
  414.         <prefix>.rad    Control file organizing the various data together
  415.                         for a complete RADIANCE scene description.
  416.         <prefix>.mat    Material definitions (all same) for manual editing.
  417.         <prefix>.view   View file.
  418.         <prefix>.sun    Daylight source definitions.
  419.         makefile        Rule definitions for the UNIX utility make.
  420.  
  421.  
  422.  
  423. REQUIREMENTS
  424.     Torad.lsp is meant to run with most versions of Autocad on any hardware
  425.     Autocad runs on. Naturally, polyface meshes will not be extracted from
  426.     version earlier than 11 drawings since they simply don't exist there.
  427.     The dialog box control is unique to version 12 up to now. With other
  428.     versions the setup is done by text input and the screen menu.
  429.  
  430.  
  431.  
  432. CAVEATS
  433.     Since torad.lsp uses layernames to form filenames in "Layer" or
  434.     "Toplayer" mode when running on a PC under DOS you will have to choose
  435.     your layernames very carefully and/or even enter a null string for the
  436.     filename prefix. If the resulting filename is longer than 8 characters
  437.     (that is the layername is longer than 5 [!] characters) torad.lsp will
  438.     refuse to open the corresponding file.
  439.  
  440.     Please note that the AME solid modelling package by Autodesk generates
  441.     surfaces with surface normals pointing to the inside of the created
  442.     volumes (at least most of the times...).
  443.  
  444.  
  445.  
  446. BUGS
  447.     There is no support yet for creating instances out of uniformly
  448.     scaled blocks (RADIANCE does not support nonuniform scaling anyway).
  449.  
  450.     The method of assigning just one standard material to all surfaces is
  451.     rather primitive. It would be nice to have access to a library of
  452.     predefined material types or at least to extract rgb-values out of the
  453.     Autocad color numbers.
  454.  
  455.  
  456.  
  457. AUTHOR
  458.     Georg Mischler
  459.  
  460.  
  461.  
  462. ACKNOWLEDGEMENTS
  463.     Final developement of this program has been sponsored by Prof. Dr.
  464.     B. Keller, Building Physics, Dep. for Architekture ETH Zurich.
  465.     The developement environment has been provided by Prof. Dr.
  466.     G. Schmitt, Architecture & CAAD ETH Zurich.
  467.  
  468.  
  469.  
  470. SEE ALSO
  471.     Autolisp Programmers References, Reference Manuals and Customisation
  472.     Guides for Autocad Versions 10/11/12, AutoDesk Inc.
  473.     Tutorial and manual pages of RADIANCE 2.1, Synthetic Imaging System.
  474.     Greg Ward, Lawrence Berkeley Laboratory, Berkeley, CA.
  475.  
  476. *****************************************************************************
  477.